import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
const Recommend = resolve => {
  import('../components/recommend/recommend').then(module => {
    resolve(module)
  })
}
const Singer = resolve => {
  import('../components/singer/singer').then(module => {
    resolve(module)
  })
}
const Rank = resolve => {
  import('../components/rank/rank').then(module => {
    resolve(module)
  })
}
const Search = resolve => {
  import('../components/search/search').then(module => {
    resolve(module)
  })
}
const SingerDetail = resolve => {
  import('../components/singer-details/singer-details').then(module => {
    resolve(module)
  })
}
export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/recommend' // 重定向，第一次进来默认跳转的页面
    },
    {
      path: '/recommend',
      component: Recommend
    },
    {
      path: '/singer',
      component: Singer
    },
    {
      path: '/details/:id',
      component: SingerDetail
    },
    {
      path: '/rank',
      component: Rank
    },
    {
      path: '/search',
      component: Search
    }
  ]
})
